<html>
  <head>
    <title>HOME</title>
	<script type = text/javascript>
	
   function strt1()	{
		
		var field1 = document.forms[0].username;
		var field2 = document.forms[0].userpwd;
		
		var usrname = field1.value;
		var usrpwd = field2.value;
		if( (usrname.indexOf("@")== -1) || (usrname.indexOf(".")==-1) || usrpwd=="" )
		{
		  alert("invalid form entry");
		  
		  return false;
		}
		return true;
	    }
	
   </script>
   </head>
  <body>
<?php
	//include("sqlconnect.php"); 
	session_start();
	
	if( (!empty($_SESSION['fname']) ) & (!empty($_SESSION['usrid']) ) & (!empty($_SESSION['loginstatus'])))  
	{
	$loginstatus = $_SESSION['loginstatus'];
	//$msg1 = $_SESSION['msg1'];
	$usrid = $_SESSION['usrid'];
	$fname= $_SESSION['fname'];
	$lname= $_SESSION['lname'];
	echo "Logged In as $fname <br>";
	 echo '		
      	  <a href="logout.php" title="LogOUT">Log-Out</a><br>
	  
	      <a href="updateprofile.php" title="LogOUT">View-Profile</a><br> ';
	} else {
				
			echo "not logged in";
			print '
	  <form name="login" action="login.php" method="POST" align ="left">
  
      <input type="text" name="username" value="" size="20" /> <br>
	  
      <input type="password" name="userpwd" value="" size="8" /> <br>
	  
	  <input type="submit" value="Sign In" name="usersignin" onclick= "return strt1(); "/> <br>
	  
	  </form> '; 
			}
	
	   ?>
</body>
</html>